<?php
include_once dirname(__FILE__)."/common/basic.php";
$res = array();
if($_GET[nav]=='feed'){
	/*$res[myuid]=$_SESSION[uid];
	$res[weburl]=$config[weburl];
	if($_GET[feedid]){
		$feed = $func->getFeedDetail($_GET[feedid]);
		if($feed){
			$res[success]=true;
			$res[feed]=$feed;
		}else{
			$res[success]=false;
			$res[error]="该分享不存在或已被删除";
		}
	}else{
		$res[success]=false;
		$res[error]="没有指定分享的ID号";
	}
	echo json_encode($res);
	die();*/
}elseif($_GET[nav]=='my'){
	if ($func->hasLogedIn()){
		
		$page = $_GET[page]?$_GET[page]:1;
		$pagesize=20;
		
		$total = $func->getTimelineCount($_SESSION[uid]);
		$feeds = $func->getTimeline($_SESSION[uid],$page,$pagesize);
		if($feeds!==false){
			$res[success]=true;
			$res[pagesize]=$pagesize;
			$res[page]=$page;
			$res[total]=$total;
			$res[feeds]=$feeds;
		}else{
			$res[success]=false;
			$res[error]="数据加载失败，请稍后再试。";
		}
	}else{
		$res[success]=false;
		$res[error]="请先<a href='login.php'>登录</a>";
	}
	echo json_encode($res);
	die();
}elseif($_GET[nav]=='explore'){
	/*$page = $_GET[page]?$_GET[page]:1;
	$pagesize=20;
	
	$total = $total = $func->getFeedsCount();
	$feeds = $func->getRecentFeeds($page,$pagesize);
	$res[success]=true;
	$res[pagesize]=$pagesize;
	$res[page]=$page;
	$res[total]=$total;
	$res[feeds]=$feeds;
	
	echo json_encode($res);
	die();*/
}elseif($_GET[nav]=='feeds'){
/*
	if($_GET[uid]){
		$page = $_GET[page]?$_GET[page]:1;
		$pagesize=20;
		
		$total = $func->getFeedsCount($_GET[uid]);
		$feeds = $func->getFeeds($_GET[uid],$page,$pagesize);
		
		$res[success]=true;
		$res[pagesize]=$pagesize;
		$res[page]=$page;
		$res[total]=$total;
		$res[feeds]=$feeds;
	}else{
		$res[success]=false;
		$res[error]="该用户不存在或暂时不可访问";
	}
	echo json_encode($res);
	die();*/
}elseif($_GET[nav]=='search'){
	/*if(trim($_GET[skey]) && $_GET[lx] && $_GET[sj]){
		$page = $_GET[page]?$_GET[page]:1;
		$pagesize = 10;
		$total = $func->search_resource_count($_GET[skey],$_GET[lx],$_GET[sj]);
		$feeds = $func->search_resource($_GET[skey],$_GET[lx],$_GET[sj], $page, $pagesize);
		if($feeds!==false){
			$res[success]=true;
			$res[page]=$page;
			$res[pagesize]=$pagesize;
			$res[total]=$total;
			$res[feeds]=$feeds;
		}else{
			$res[success]=false;
			$res[error]="查询失败，请稍后再试";
		}
	}else{
		$res[success]=false;
		$res[error]="请先设置查询条件";
	}
	echo json_encode($res);*/
}
?>